﻿using Microsoft.Graphics.Canvas;
using Microsoft.Graphics.Canvas.Effects;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using 纸片人.Shaders;

namespace 纸片人.win2dEffectControl.DataClass.PixelShaderEffectDataClass
{
    /// <summary>
    /// 清除透明度效果
    /// </summary>
    public class ClearTransparencyEffectData : PixelShaderEffectData
    {
        public override ShaderType shaderShaderPath { get; } = ShaderType.ClearTransparency;

        public override ICanvasImage GetEffect(CanvasDevice device, bool compression)
        {
            var source = GetSourceEffect(device, compression);
            if (source == null)
            {
                return null;
            }

            if (shaderCodeBytes == null)
                return null;

            PixelShaderEffect effect = new PixelShaderEffect(shaderCodeBytes)
            {
                Source1 = source,
            };
         
            return effect;
        }
    }
}